/*******************************************************************/
CREATE PROCEDURE coreKnownAddinSave
( 
	@PK_ID int output,
	@GUID nvarchar(150),
	@AddinName nvarchar(200),
	@VersionString nvarchar(50)
)
AS
BEGIN
	IF( @PK_ID = -1 )
	BEGIN
		SET NOCOUNT ON;
		INSERT INTO UpdateAddins (GUID, AddinName, VersionString) VALUES (@GUID, @AddinName, @VersionString);
		SET NOCOUNT OFF;
		SELECT @PK_ID = @@IDENTITY;
	END
	ELSE
	BEGIN
		UPDATE UpdateAddins SET AddinName=@AddinName, VersionString=@VersionString WHERE PK_ID=@PK_ID;
	END
END
